﻿Imports System.Data.SqlClient
Imports Microsoft.Reporting.WinForms
Public Class FormReportStock

    Private Sub FormReportStock_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim cn As New SqlConnection()
        cn.ConnectionString = "server=WINCTRL-B8GV7ME;uid=sa;pwd=123;database=AppSaleDb;"
        cn.Open()

        Dim cmd As New SqlCommand()
        cmd.Connection = cn
        cmd.CommandText = "SELECT * FROM tbl_Products"
        Dim reader As SqlDataReader = cmd.ExecuteReader()

        Me.ReportViewer1.LocalReport.DataSources.Add(New ReportDataSource("DataSetReportStock", reader))
        Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "StockSale.ReportStock.rdlc"
        Me.ReportViewer1.ZoomMode = ZoomMode.FullPage
        Me.ReportViewer1.RefreshReport()
    End Sub

    Private Sub ReportViewer1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ReportViewer1.Load

    End Sub
End Class